package com.leo.model;

import com.leo.util.DateUtil;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;

/**
 * @ClassName: MyBeanPostProcess
 * @Description: ${description}
 * @Author: leo825
 * @Date: 2020-02-24 22:03
 * @Version: 1.0
 */
public class MyBeanPostProcess implements BeanPostProcessor {

    public MyBeanPostProcess(){
        super();
        System.out.println(DateUtil.getTimeNow() + "调用BeanPostProcess构造方法");
    }

    @Override
    public Object postProcessBeforeInitialization(Object o, String s) throws BeansException {
        System.out.println(DateUtil.getTimeNow() + "调用BeanPostProcess的postProcessBeforeInitialization(),[" + s + "]");
        return o;
    }

    @Override
    public Object postProcessAfterInitialization(Object o, String s) throws BeansException {
        System.out.println(DateUtil.getTimeNow() + "调用BeanPostProcess的postProcessAfterInitialization(),[" + s + "]");
        return o;
    }
}
